package smcms.service.cloudstore.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import smcms.commons.api.entity.result.CommonsResult;
import smcms.service.cloudstore.service.FileManagerService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/FileManagerController")
public class FileManagerController {

    @Autowired
    private CommonsResult commonsResult;
    @Autowired
    private FileManagerService fileManagerService;

    @PostMapping("/uploadFile")
    public CommonsResult uploadFile(@RequestParam("file") MultipartFile file,
                                    @RequestParam("fileType") String fileType,
                                    @RequestParam("operatorName") String operatorName
                                    )
    {
        CommonsResult commonsResult = fileManagerService.uploadFile(file, fileType, operatorName);
        return commonsResult;
    }

}
